import json

transfer_list = [
    ["vivaldi", "mail", "accounts"],
    ["vivaldi", "privacy"],
    ["vivaldi", "translate"],
    ["vivaldi", "toolbars"],
    ["vivaldi", "windows"],
    ["vivaldi", "panels"],
    ["default_search_provider_data", "template_url_data"],
]
current_setting_file = "/run/user/1000/psd/isidore-vivaldi/Default/Preferences"

with open("vivaldi.json") as f:
    setting_dict = json.load(f)

with open(current_setting_file) as f:
    current_dict = json.load(f)

for transfer in transfer_list:
    src = setting_dict
    dst = current_dict
    while len(transfer) > 1:
        key = transfer.pop(0)
        src = src[key]
        dst = dst[key]
    key = transfer.pop(0)
    dst[key] = src[key]

with open(current_setting_file, "w") as f:
    json.dump(current_dict, f, indent=4)
